package propertydemo.propertydemo.property;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

import java.io.Serializable;

/**
 * @Description:外部属性的配置对象，也要在controller配置
 * @Author: liujinsheng
 * @Date: 2021/7/19.
 */
@Component
@PropertySource("classpath:test.properties")
@ConfigurationProperties(prefix = "users")
@Data
public class Users implements Serializable {
    private String name;
    private  Integer age;
}
